<!DOCTYPE html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <title>Unresolved</title>
  <script src="../../../../webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="../../../polymer.html">
  <script src="../../../../tools/test/htmltest.js"></script>
  <script src="../../../../tools/test/chai/chai.js"></script>
</head>
<body unresolved>

  <x-foo unresolved></x-foo>
  <x-test unresolved></x-test>
  <x-test unresolved></x-test>

  <polymer-element name="x-test" noscript>

    <template>
      I exist!
    </template>

  </polymer-element>

  <script>
    
    document.addEventListener('polymer-ready', function() {

      function checkResolved(node) {
        chai.assert.isFalse(node.hasAttribute('unresolved'), 'element does not have unresolved attribute');
      }

      checkResolved(document.body);

      Array.prototype.forEach.call(document.querySelectorAll('x-test'), function(t) {
        checkResolved(t);
      });

      chai.assert.isTrue(document.querySelector('x-foo').hasAttribute('unresolved'), 'unresolved exists on un-upgraded element');

      done();
    });
  </script>
</body>
</html>
